package main

import fmt "fmt"

func Count(ch chan int) {
	fmt.Println("Counting")
	ch <- 1
}

func main() {

	chs := make([]chan int, 10) //创建数组切片,数组元素为channel,channel元素类型为int,默认长度为10

	for i := 0; i < 10; i++ {
		chs[i] = make(chan int) //初始化channel
		go Count(chs[i])        //开启协程
	}

	for _, ch := range chs {
		value := <-ch
		// fmt.Println(value)｀
	}

}
